//package com.yupi.springbootinit.bizmq;
//
//import com.rabbitmq.client.Channel;
//import com.rabbitmq.client.Connection;
//import com.rabbitmq.client.ConnectionFactory;
//
//import java.io.IOException;
//import java.util.concurrent.TimeoutException;
//
///**
// * 用于创建测试用的交换机和队列，只用执行一次
// */
//public class MqInitMain {
//    public static void main(String[] args) {
//        ConnectionFactory factory = new ConnectionFactory();
//        factory.setHost("localhost");
//        try {
//            Connection connection = factory.newConnection();
//            Channel channel1 = connection.createChannel();
//            String EXCHANGE_NAME="code_exchange";
//            channel1.exchangeDeclare(EXCHANGE_NAME, "fanout");
//            String queueName = "code_queue";
//            channel1.queueDeclare(queueName, true, false, false, null);
//            channel1.queueBind(queueName, EXCHANGE_NAME, "my_routingkey");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//}
